package Anceser;

public class Test1 {
    //井字棋
    public static boolean func(int [][] array){
        if(array[0][0] + array[1][1] + array[2][2] == 3){
                return true;
        }
        if(array[2][0] + array[1][1] + array[0][2] == 3){
                return true;
        }
        for (int i = 0; i < 3; i++) {
            if(array[i][0] + array[i][1] + array[i][2] == 3){
                return true;
            }
            if(array[0][i] + array[1][i] + array[2][i] == 3){
                return true;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int [][] array = {{-1,1,1},{1,0,-1},{1,-1,0}};
        boolean ret = func(array);
        System.out.println(ret);
    }
}
